//
//
//


#ifndef CGAMECLIENT_H
#define CGAMECLIENT_H

#include <irrlicht.h>
#include <vector>
#include <string>
#include "CBulletPhysics.h"
#include "CAvatar.h"
#include "CVirtualWorld.h"
#include "CClientLinker.h"
#include "CGameStateHandler.h"
//#include "Lua Loader/CLuaLoader.h"

class CGameClient
{
public:
	static	CGameClient*	Instance();

	virtual	bool	Init(std::string url);
	virtual	bool	Run();
	//virtual	bool	Update();
	
	virtual	irr::IrrlichtDevice*	GetIrrlicht()	{ return	m_pIrrlicht; }
	virtual	CBulletPhysics*		GetBulletPhysics()	{ return	m_pBulletPhysics; }
	virtual	irr::scene::IAnimatedMeshSceneNode*		GetAvatars( int i )	{ return m_vAvatars[i]; }
	virtual	int	GetAvatarNum()	{ return m_vAvatars.size(); }
	virtual	CClientLinker*	GetNetwork()	{ return m_pNetwork; }
protected:
	CGameClient();

	irr::IrrlichtDevice*	m_pIrrlicht;
	CBulletPhysics*		m_pBulletPhysics;
	//CLuaLoader*			m_pLuaLoader;
private:
	static	CGameClient*	m_pGameInstance;

	//std::vector<CAvatar*>	m_vAvatar;
	std::vector<irr::scene::IAnimatedMeshSceneNode*>	m_vAvatars;
	
	CVirtualWorld*	m_pWorld;

	CClientLinker* m_pNetwork;

	CGameStateHandler*	m_pGameState;
};



#endif